package comm;

import org.apache.commons.lang.math.RandomUtils;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class Utils {

	public static void main(String[] args) {
		System.out.println(RandomUtils.nextInt(10));
	}
	public static void changeip() throws Exception {
		Connection conn = Jsoup.connect("http://192.168.1.1/");
		conn.header("Authorization", "Basic YWRtaW46YWRtaW4=");
		Document d = conn.get();

		String disconnUrl = "http://192.168.1.1/userRpm/StatusRpm.htm?Disconnect=%B6%CF%20%CF%DF&wan=1";
		Connection conn1 = Jsoup.connect(disconnUrl);
		conn1.header("Authorization", "Basic YWRtaW46YWRtaW4=");
		Document d1 = conn1.get();

		String connUrl = "http://192.168.1.1/userRpm/StatusRpm.htm?Connect=%C1%AC%20%BD%D3&wan=1";
		Connection conn2 = Jsoup.connect(connUrl);
		conn2.header("Authorization", "Basic YWRtaW46YWRtaW4=");
		Document d2 = conn2.get();
		
		Thread.sleep(10000);
	}

}
